package com.wc.alorithm_blue_bridge._思维.小球反弹;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2025/4/3 16:20
 * @description
 * https://www.lanqiao.cn/problems/19732/learning/?page=1&first_category_id=1&name=%E5%B0%8F%E7%90%83%E5%8F%8D%E5%BC%B9
 */
public class Main {
    static int dx = 15, dy = 17;
    static long h = 233333, w = 343720;

    public static void main(String[] args) {
        double x = 0, y = 1;
        while (y * dx * h % (dy * w) != 0) {
            y++;
        }
        x = y * dx * h / (dy * w);
        if (x % 2 != 0) {
            x *= 2;
            y *= 2;
        }
        double a = x * w, b = y * h;
        double dist = Math.sqrt(a * a + b * b);
        System.out.printf("%.2f\n", dist);
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

